﻿<UserControl
    x:Class="QDP.Platform.Admin.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
    xmlns:controls="clr-namespace:QDP.Platform.Admin.Controls" >

    <Grid>

        <controls:TiledBackground SourceUri="/QDP.Platform.Admin;component/Images/backgroundtexture.png" />
        <Image Source="/QDP.Platform.Admin;component/Images/backgroundshadow.png" Stretch="Fill" />

        <Border Style="{StaticResource BackgroundBorderStyle}" />
        <Border Style="{StaticResource NavLinksBorderStyle}" />

        <Grid x:Name="LayoutRoot" Style="{StaticResource LayoutRootGridStyle}">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="*" />
            </Grid.RowDefinitions>

            <StackPanel Style="{StaticResource LinksStackPanelStyle}" HorizontalAlignment="Right">
                <HyperlinkButton Style="{StaticResource LinkStyle}" Content="新建参数"
                                 Command="{Binding AddSetCommand,Source={StaticResource ViewModel}}"/>
                <HyperlinkButton Style="{StaticResource LinkStyle}" Content="新增加载项"
                                 Command="{Binding AddUrlCommand,Source={StaticResource ViewModel}}"/>
                <HyperlinkButton Style="{StaticResource LinkStyle}" Content="保存"
                                 Command="{Binding SaveCommand,Source={StaticResource ViewModel}}"/>
                <HyperlinkButton Style="{StaticResource LinkStyle}" Content="重新加载"
                                 Command="{Binding RefreshCommand,Source={StaticResource ViewModel}}"/>
            </StackPanel>
            
            <StackPanel x:Name="LinksStackPanel" Style="{StaticResource LinksStackPanelStyle}">
                <HyperlinkButton Style="{StaticResource LinkStyle}" TargetName="ContentFrame"
                                 NavigateUri="Option" Content="参数设置" />
                <HyperlinkButton Style="{StaticResource LinkStyle}" TargetName="ContentFrame"
                                 NavigateUri="Imports" Content="加载项" />
            </StackPanel>

            <Border x:Name="ContentBorder" Grid.Row="1"
                    Style="{StaticResource NavContentBorderStyle}">
                <navigation:Frame x:Name="ContentFrame" Source="Option" 
                                  Style="{StaticResource NavContentFrameStyle}"
                                  Navigated="ContentFrame_Navigated"
                                  NavigationFailed="ContentFrame_NavigationFailed" />
            </Border>
        </Grid>
    </Grid>
</UserControl>